home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / lang / HeliOS3.lha / helios_demo_disk3 / source / SimpleHSpriteFromSCtrl.src < prev    next >
Encoding:
Text File  |  1995-11-11  |  17.3 KB  |  673 lines

  1.  
  2.   \ ***********************************************************
  3.   \
  4.   \   SIMPLE SINGLE HARDWARE SPRITE FROM SOFTWARE SPRITE DEMO
  5.   \
  6.   \ ***********************************************************
  7.   \
  8.   \ This code demonstrates how to create a simple single hardware
  9.   \ sprite using imagery derived from a software sprite structure.
  10.   \
  11.   \ The software sprite used for the (8-colour) gun turret is also
  12.   \ used as the source of the hardware sprite imagery.
  13.   \
  14.   \ Notice that the process of extracting a four colour image from
  15.   \ an eight colour bitmapped object is perfectly "legal" but will
  16.   \ usually (as in this case) result in distorted colour rendition.
  17.   \
  18.   \ ***********************************************************
  19.  
  20.  
  21.   \ ***********************************************************
  22.   \ Re-initialise HeliOS dictionary to standard CORE vocabulary
  23.   \ ***********************************************************
  24.  
  25.   \ This should always be used at the start of any program which
  26.   \ is to be repeatedly recompiled.
  27.  
  28.   FORGET **CORE**
  29.  
  30.   \ *************************
  31.   \ Load include symbol files
  32.   \ *************************
  33.   \
  34.   \ These "include files" are pre-compiled (for speed) versions of the
  35.   \ Amiga includes and the Helios system includes.
  36.   \
  37.   \ Uncomment the lines below for standalone compilation, but otherwise
  38.   \ it is better to set these include files from the Helios Forth menus
  39.  
  40.   AMIGAINCLUDE HeliOS:HeliOS_AmigaInclude
  41.   USERINCLUDE  HeliOS:HeliOS_UserInclude
  42.  
  43.   \ ****************************************
  44.   \ Create display imagery file name strings
  45.   \ ****************************************
  46.  
  47.   \ These files are ordinary IFF's (and may be "PowerPacked" if required)
  48.   \
  49.   \ The pictures here will be loaded into each of the display BitMaps.
  50.   \
  51.  
  52.   $CONSTANTL Slice1Pic $Helios:Source/Data/Pic1$
  53.  
  54.   \ **************************************
  55.   \ Create display configuration constants
  56.   \ **************************************
  57.   \
  58.   \ Collect all "display-specific" parameters here and generate "named"
  59.   \ constants which make references easier than using numeric values.
  60.   \
  61.   \ Collecting these together here makes it easier to adjust things at any
  62.   \ time without having to search source code to replace values individually.
  63.   \
  64.  
  65.  
  66.   256                      CONSTANT DisplayHeight      \ Full PAL display
  67.   320                      CONSTANT DisplayWidth       \ Lores display
  68.   44                       CONSTANT DisplayTopLine     \ Display start
  69.  
  70.   DisplayWidth             CONSTANT Slice1Width        \ Lores width
  71.   DisplayWidth 32 +        CONSTANT Slice1RasterWidth  \ Raster=SWidth+32
  72.   DisplayHeight            CONSTANT Slice1Height       \ Slice height
  73.   DisplayHeight 32 +       CONSTANT Slice1RasterHeight \ Slice Raster=DHgt+32
  74.   0                        CONSTANT Slice1Mode         \ Lores
  75.   3                        CONSTANT Slice1Planes       \ Slice bitplanes
  76.  
  77.   \ The calculation below takes the number of bitplanes and calculates
  78.   \ how many colours this represents.
  79.   \
  80.   \ One bitplane gives two colours.
  81.   \
  82.   \ Each additional bitplane multiplies the number of colours by two.
  83.   \
  84.   \ Performing a single LSL operation on any number multipies by 2, so we
  85.   \ have a quick method of multiplying by two for our colour calculation.
  86.   \
  87.   \ In this case, we need "2 to the power 3", which is 2*2*2=8.
  88.   \
  89.   \ e.g.                              2*2*2
  90.   \                                   ^ ^ ^
  91.   \                                   Total number of planes = 3
  92.   \
  93.   \
  94.   \ So, we take the first value two
  95.   \
  96.   \ e.g.                              2*2*2
  97.   \                                   ^
  98.   \                                  Initial start value of 2
  99.   \
  100.   \ and we now need to multiply it by two "the_number_of_planes minus_one"
  101.   \ more times.
  102.   \
  103.   \ e.g.                              2*2*2
  104.   \                                     ^ ^
  105.   \                                     Total planes minus one
  106.   \
  107.   \
  108.   \ So, Number of colours = 2 operated on by LSL NumberOfPlanes-1 times.
  109.   \
  110.  
  111.   2 Slice1Planes 1- LSL    CONSTANT Slice1Colours      \ A-slice colours
  112.  
  113.   \ ***********************
  114.   \ Error handling routines
  115.   \ ***********************
  116.  
  117.   \ This error handler allows all errors to be routed via a comprehensive
  118.   \ sequential closedown routine, which is associated with the HeliOS
  119.   \ system error handler word ERROR".
  120.   \
  121.   \ When ERROR" senses an error, it prints an associated error message
  122.   \ delimited by '"' characters, and then closes everything down using the
  123.   \ routine CLOSEDOWN below which you have supplied.
  124.   \
  125.   \ This simplifies errors checks to the use of a single word, ERROR", which
  126.   \ displays a text message and closes eveything down.
  127.   \
  128.  
  129.   0 VARIABLE (CLOSEDOWN)
  130.  
  131.   : ?CLOSEDOWNERROR
  132.  
  133.   IF
  134.     CR
  135.     CR
  136.     TYPE
  137.     CR
  138.     CR
  139.     ." Press <Space> to quit!"
  140.     CR
  141.     CR
  142.     WAITSPACE
  143.     (CLOSEDOWN) @EXECUTE
  144.     QUIT
  145.   ELSE
  146.     DDROP
  147.   THEN
  148.   ;
  149.  
  150.   LATESTCFA VARIABLE ERROR1
  151.  
  152.   \ ****************************************
  153.   \ Create display pointer storage variables
  154.   \ ****************************************
  155.  
  156.   \ Here we create a set of "pointers", initially set to a "null" value.
  157.   \
  158.   \ These "pointers" are set up as "long addresses" when various components
  159.   \ of the display system are allocated and initialised.
  160.   \
  161.   \ Note that initially these are all set to zero, and we clear them back
  162.   \ to zero when we de-allocate the associated resource.
  163.   \
  164.   \ These DPOINTERs are all initially set to "null" by using '0.'.
  165.   \
  166.   \ When we allocate memory or Amiga system resources in the program at
  167.   \ run-time, these pointers are updated to contain the 32-bit address
  168.   \ of the newly allocated resource.
  169.   \
  170.   \ Subsequently the symbolic DPOINTER name can be used in your code to
  171.   \ represent the associated address.
  172.  
  173.   0. DPOINTER Display1             \ Main Display structure pointer
  174.   0. DPOINTER Slice1               \ Slice 1 Slice structure pointer
  175.  
  176.   0. DPOINTER Slice1_ColorMap      \ Slice 1 ColourMap structure pointer
  177.  
  178.   0. DPOINTER Slice1_RasInfo       \ Slice 1 RasInfo structure pointer
  179.  
  180.   0. DPOINTER Slice1_BMap          \ Slice 1 BitMap structure pointer
  181.  
  182.   0. DPOINTER Slice1_SliceControl  \ Slice 1 SliceControl structure pointer
  183.  
  184.   \ *************
  185.   \ Colour tables
  186.   \ *************
  187.  
  188.   \ Each colour entry requies 2 bytes of storage space
  189.  
  190.   CREATEL Slice1_ColorTable        \ Create longword pointer to table
  191.   Slice1Colours 2* 0 ALLOTFILL     \ Allocate Slice1 colours * 2 bytes
  192.  
  193.  
  194.   \ *************************************
  195.   \ Copper strip for graduated background
  196.   \ *************************************
  197.  
  198.   0. DVARIABLE Copper              \ 32-bit CopperList pointer store
  199.   0. DVARIABLE CopperLength        \ 32-bit CopperList length store
  200.  
  201.   : AddCopper                      \ Add custom copper list to display
  202.  
  203.   Display1                         \ We are adding CopperList to Display1
  204.   Copper D@
  205.   ADDCOPPERSTRIP
  206.   SORTSTRIPTABLE
  207.   LINKSTRIPS
  208.   DDROP
  209.   ;
  210.  
  211.   : RemCopper                      \ Remove custom copper list from display
  212.  
  213.   Display1                         \ We are removing CopperList from Display1
  214.   Copper D@
  215.   DFLAG
  216.   IF
  217.     REMCOPPERSTRIP
  218.     LINKSTRIPS
  219.     DDROP
  220.   ELSE
  221.     DDDROP
  222.   THEN
  223.   ;
  224.  
  225.   : Create_Copper
  226.  
  227.   COPPERSTART
  228.   Copper D!
  229.   0 [ DECIMAL ]  45 [ HEX ] FFFE COPPERWAIT  DROP   0100 18E COPPERMOVE  DROP
  230.   0 [ DECIMAL ]  60 [ HEX ] FFFE COPPERWAIT  DROP   0200 18E COPPERMOVE  DROP
  231.   0 [ DECIMAL ]  75 [ HEX ] FFFE COPPERWAIT  DROP   0300 18E COPPERMOVE  DROP
  232.   0 [ DECIMAL ]  90 [ HEX ] FFFE COPPERWAIT  DROP   0400 18E COPPERMOVE  DROP
  233.   0 [ DECIMAL ] 105 [ HEX ] FFFE COPPERWAIT  DROP   0500 18E COPPERMOVE  DROP
  234.   0 [ DECIMAL ] 120 [ HEX ] FFFE COPPERWAIT  DROP   0600 18E COPPERMOVE  DROP
  235.   0 [ DECIMAL ] 135 [ HEX ] FFFE COPPERWAIT  DROP   0700 18E COPPERMOVE  DROP
  236.   0 [ DECIMAL ] 150 [ HEX ] FFFE COPPERWAIT  DROP   0800 18E COPPERMOVE  DROP
  237.   0 [ DECIMAL ] 165 [ HEX ] FFFE COPPERWAIT  DROP   0900 18E COPPERMOVE  DROP
  238.   0 [ DECIMAL ] 180 [ HEX ] FFFE COPPERWAIT  DROP   0A00 18E COPPERMOVE  DROP
  239.   0 [ DECIMAL ] 195 [ HEX ] FFFE COPPERWAIT  DROP   0B00 18E COPPERMOVE  DROP
  240.   0 [ DECIMAL ] 210 [ HEX ] FFFE COPPERWAIT  DROP   0C00 18E COPPERMOVE  DROP
  241.   0 [ DECIMAL ] 225 [ HEX ] FFFE COPPERWAIT  DROP   0D00 18E COPPERMOVE  DROP
  242.   0 [ DECIMAL ] 240 [ HEX ] FFFE COPPERWAIT  DROP   0E00 18E COPPERMOVE  DROP
  243.   0 [ DECIMAL ] 255 [ HEX ] FFFE COPPERWAIT  DROP   0F00 18E COPPERMOVE  DROP
  244.   [ DECIMAL ]
  245.   COPPEREND
  246.   CopperLength D!   Copper D!
  247.   ADDCOPPER
  248.   ;
  249.  
  250.   : Free_Copper                  \ Closes down and frees copperlist memory
  251.  
  252.   RemCopper
  253.   Copper D@ FREEMEMORY
  254.   ;
  255.  
  256.   \ ***********************************
  257.   \ Create Display and Slice structures
  258.   \ ***********************************
  259.  
  260.   \ This routine simply makes blank structures, which then need to be
  261.   \ initialised later (in the CREATE_DISPLAY routine).
  262.  
  263.   : CREATE_DSLICES
  264.  
  265.   DS_SIZEOF MAKESTRUCTURE Display1 MAKEPOINTER  \ Main "Display" structure
  266.  
  267.   SL_SIZEOF MAKESTRUCTURE Slice1   MAKEPOINTER  \ Display "Slice" structure
  268.   ;
  269.  
  270.   : FREE_DSLICES
  271.  
  272.   Slice1    DDUP FREEMEMORY   CLEARPOINTER
  273.   Display1  DDUP FREEMEMORY   CLEARPOINTER
  274.   ;
  275.  
  276.   \ ******************************
  277.   \ Create RasInfo structures etc.
  278.   \ ******************************
  279.  
  280.   : CREATE_RASINFO
  281.  
  282.   \ First allocate and initialise complete RasInfo structures.
  283.   \
  284.   \ This routine automatically allocates all BitMaps etc.
  285.   \
  286.  
  287.   Slice1RasterWidth Slice1RasterHeight Slice1Planes  OPENRASINFO
  288.   DFLAG0= ERROR" Fail: RasInfo1"
  289.   Slice1_RasInfo MAKEPOINTER
  290.  
  291.   \ Set invisible area "sprite margins" for slice RasInfo
  292.  
  293.   16              Slice1_RasInfo         ri_RxOffset    INDEX!L
  294.   16              Slice1_RasInfo         ri_RyOffset    INDEX!L
  295.  
  296.   \ Store BitMap pointer - often useful for later reference
  297.  
  298.   Slice1_RasInfo  ri_BitMap INDEXD@L Slice1_BMap MAKEPOINTER
  299.   ;
  300.  
  301.   : FREE_RASINFO
  302.  
  303.   Slice1_RasInfo   DDUP CLOSERASINFO   CLEARPOINTER
  304.   ;
  305.  
  306.   \ ********************************
  307.   \ Create Display/Slice Copperlists
  308.   \ ********************************
  309.  
  310.   \ This function builds the main display copperlist by:
  311.   \
  312.   \ 1. Initialising the Slice data structure
  313.   \ 2. Calling MAKECOPSTRIP for the slice, to build a copperlist
  314.   \ 3. Calling MAKEDISPLAY to build the master Display copperlist
  315.   \
  316.  
  317.   : CREATE_DISPLAY
  318.  
  319.   \ First initialise main display structures
  320.  
  321.   Slice1                           Display1  DS_Slice     INDEXD!L
  322.  
  323.   Slice1Width                      Slice1    SL_DWidth    INDEX!L
  324.   Slice1Height                     Slice1    SL_DHeight   INDEX!L
  325.   DisplayTopLine                   Slice1    SL_DyOffset  INDEX!L
  326.   Slice1_RasInfo                   Slice1    SL_RasInfo   INDEXD!L
  327.   Slice1_ColorMap                  Slice1    SL_ColorMap  INDEXD!L
  328.   Slice1Mode                       Slice1    SL_Modes     INDEX!L
  329.  
  330.   \ Generate copper list information for each of the display slices
  331.  
  332.   Slice1 MAKECOPSTRIP
  333.   D0= ERROR" Fail: Slice1CopStrip"
  334.  
  335.   \ Make display
  336.  
  337.   Display1 MAKEDISPLAY
  338.   D0= ERROR" Fail: Display1"
  339.   ;
  340.  
  341.   : FREE_DISPLAY
  342.  
  343.   Display1                 FREEDISPLAY
  344.   Slice1                   FREECOPSTRIP
  345.   ;
  346.  
  347.   \ ********************************************************
  348.   \ Create SliceControl structures for double buffered slice
  349.   \ ********************************************************
  350.  
  351.   \ SliceControl structures are used to control any slices which perform
  352.   \ mapping or scrolling functions, or which require double or triple
  353.   \ playfield buffering.
  354.   \
  355.   \ In this case we have one slice which does not scroll, is not mapped,
  356.   \ but IS double buffered.
  357.   \
  358.  
  359.   : CREATE_SLICECONTROL
  360.  
  361.   \ Make SliceControl for double buffered bitmap display
  362.  
  363.   Slice1  0 0 MAKESLICECONTROL
  364.   DFLAG0= ERROR" Fail: SliceControl1"
  365.   Slice1_SliceControl MAKEPOINTER
  366.  
  367.   \ Install slice controls into HeliOS display control system
  368.  
  369.   Slice1_SliceControl  INSTALLSLICECONTROL
  370.   ;
  371.  
  372.   : FREE_SLICECONTROL
  373.  
  374.   CLEARSLICECONTROLS
  375.   Slice1_SliceControl  CLOSESLICECONTROL
  376.   ;
  377.  
  378.   \ These routines load an IFF picture into supplied BitMap, and correctly
  379.   \ initialises the supplied ColorTable.
  380.   \
  381.   \ The ColorTable is then used to create an initialised ColorMap structure.
  382.   \
  383.  
  384.   : CREATE_IMAGERY
  385.  
  386.   Slice1_BMap
  387.   Slice1_ColorTable
  388.   Slice1Pic
  389.   10 2 DOSLIB                        \ Call to internal HeliOS library
  390.   10 <> ERROR" Fail: Slice1Pic"
  391.  
  392.   Slice1_ColorTable  Slice1Colours MAKECOLORMAP  \ Allocate ColourMap
  393.   DFLAG0= ERROR" Fail: Slice1ColorMap"
  394.   Slice1_ColorMap MAKEPOINTER
  395.   ;
  396.  
  397.   : FREE_IMAGERY
  398.  
  399.   Slice1_ColorMap  DDUP FREECOLORMAP  CLEARPOINTER
  400.   ;
  401.  
  402.   \ ***********
  403.   \ Sprite Demo
  404.   \ ***********
  405.  
  406.   \ *********************
  407.   \ Sprite Demo constants
  408.   \ *********************
  409.  
  410.   \ Store the gun speed as a CONSTANT
  411.  
  412.   4  CONSTANT GunSpeed             \ Speed of Gun movement
  413.  
  414.   \ *************************************************
  415.   \ Create sprite demo pointers and storage variables
  416.   \ *************************************************
  417.  
  418.   0. DPOINTER GunSpriteSet         \ Gun sprite image
  419.  
  420.   \ ***************************
  421.   \ User input response routine
  422.   \ ***************************
  423.  
  424.   : MoveGun
  425.  
  426.   RAWKEY @ 78 =
  427.   JOY1LEFTRIGHT 0>
  428.   OR
  429.   IF
  430.      GunSpeed
  431.      19 320
  432.      GunSpriteSet 8. D+ D@L SpriteCtrl_XPos D+
  433.      LIMIT+!L
  434.   ELSE
  435.     RAWKEY @ 79 =
  436.     JOY1LEFTRIGHT 0<
  437.     OR
  438.     IF
  439.      GunSpeed NEGATE
  440.      19 320
  441.      GunSpriteSet 8. D+ D@L SpriteCtrl_XPos D+
  442.      LIMIT+!L
  443.     THEN
  444.   THEN
  445.   ;
  446.  
  447.   \ ********************
  448.   \ Create sprite object
  449.   \ ********************
  450.  
  451.   : CREATE_SPRITE
  452.  
  453.   \ ----------
  454.   \ Gun sprite
  455.   \ ----------
  456.  
  457.   Slice1_BMap
  458.   154 272
  459.   13 15
  460.   1
  461.   MAKESPRITESET
  462.   DFLAG0= ERROR" Fail: Gun SpriteSet"
  463.   GunSpriteSet MAKEPOINTER
  464.  
  465.   GunSpriteSet 8. D+ D@L
  466.   DDUP  SpriteCtrl_XPos D+       170 -ROT !L
  467.         SpriteCtrl_YPos D+       239 -ROT !L
  468.  
  469.   Slice1_SliceControl   GunSpriteSet    INITSPRITESET
  470.   ;
  471.  
  472.   : FREE_SPRITE
  473.  
  474.   GunSpriteSet    DDUP FREESPRITESET CLEARPOINTER
  475.   ;
  476.  
  477.   \ ***********************************
  478.   \ Create hardware sprite colour table
  479.   \ ***********************************
  480.  
  481.   \ This colour table simply specifies a few arbitrary colours which we
  482.   \ will then set into colour registers 16 to 31
  483.  
  484.   CREATEL MySpriteColourTable
  485.  
  486.   HEX
  487.  
  488.   0000 ,  \ Colour 16
  489.   0FFF ,  \ Colour 17
  490.   0CC0 ,  \ Colour 18
  491.   0F00 ,  \ Colour 19
  492.   0AAA ,  \ Colour 20
  493.   0999 ,  \ Colour 21
  494.   0888 ,  \ Colour 22
  495.   0777 ,  \ Colour 23
  496.   0666 ,  \ Colour 24
  497.   0555 ,  \ Colour 25
  498.   0444 ,  \ Colour 26
  499.   0333 ,  \ Colour 27
  500.   0222 ,  \ Colour 28
  501.   0111 ,  \ Colour 29
  502.   00F0 ,  \ Colour 30
  503.   000F ,  \ Colour 31
  504.  
  505.   DECIMAL
  506.  
  507.   \ ***********************
  508.   \ Allocate pointer stores
  509.   \ ***********************
  510.  
  511.   0. DPOINTER  MyHSpriteData
  512.  
  513.   \ MAKEHSPRITE  - - - HSpriteData(l) or null for failure
  514.  
  515.   : MAKEHSPRITE
  516.  
  517.     1 1
  518.     GunSpriteSet 8. D+ D@L
  519.     MAKEHSPRITEBLOCK_SCTL
  520.   ;
  521.  
  522.   \ **********************
  523.   \ Set up hardware sprite
  524.   \ **********************
  525.  
  526.   \ First we set sprite colours 16 to 31
  527.   \ Then we create hardware sprite definition blocks
  528.   \ Then we install the hardware sprites
  529.  
  530.   : SetupHSprite
  531.  
  532.   Slice1 MySpriteColourTable 16 16 SETSLICECOLOURS
  533.  
  534.   MAKEHSPRITE
  535.   DFLAG
  536.   IF
  537.     MyHSpriteData MAKEPOINTER
  538.  
  539.     MyHSpriteData 0 HSPRITE_INSTALL
  540.     1 REPORTMOUSE
  541.     0 HELIOSMPOINTER
  542.     0
  543.   ELSE
  544.     DDROP
  545.     1
  546.   THEN
  547.   ;
  548.  
  549.   \ **************************
  550.   \ Close down hardware sprite
  551.   \ **************************
  552.  
  553.   \ First we remove the hardware sprites
  554.   \ Then we de-allocate the sprite definitions
  555.  
  556.   : FREE_HSPRITE
  557.  
  558.   MyHSpriteData HSPRITE_REMOVE
  559.  
  560.   MyHSpriteData  DDUP FREEHSPRITEBLOCK  CLEARPOINTER
  561.   ;
  562.  
  563.   \ ********************************
  564.   \ Display and move hardware sprite
  565.   \ ********************************
  566.  
  567.   \ Switch on mouse position reporting
  568.   \ Switch off the HeliOS mouse pointer image
  569.   \ Repeatedly set the sprite to the current mouse pointer position
  570.  
  571.   : TestHSprite
  572.  
  573.     0 MOUSEX MOUSEY 0 MyHSpriteData HSPRITE_PLACE
  574.   ;
  575.  
  576.   \ *********************
  577.   \ Close down everything
  578.   \ *********************
  579.  
  580.   : CLOSEDOWN
  581.  
  582.   FREE_HSPRITE
  583.   FREE_SPRITE
  584.   FREE_COPPER
  585.   FREE_SLICECONTROL
  586.   FREE_DISPLAY
  587.   FREE_IMAGERY
  588.   FREE_RASINFO
  589.   FREE_DSLICES
  590.   RESETERROR"
  591.   ;
  592.  
  593.   LATESTCFA (CLOSEDOWN) !
  594.  
  595.   : TestDisplay          \ Start of program
  596.  
  597.   SCRCLR
  598.   CR
  599.   ."        **********************************************************"
  600.   CR 6 FPENSET
  601.   ."          SIMPLE SINGLE HARDWARE SPRITE FROM SOFTWARE SPRITE DEMO"
  602.   CR 1 FPENSET
  603.   ."        **********************************************************"
  604.   CR
  605.   CR
  606.   ."        This code demonstrates how to create a simple single hardware"
  607.   CR
  608.   ."        sprite with imagery derived from a software sprite structure."
  609.   CR
  610.   CR
  611.   ."        **********************************************************"
  612.   CR 6 FPENSET
  613.   CR
  614.   ."                  Press <Space> or <L-Mouse> to see Demo          "
  615.   CR 3 FPENSET
  616.   CR
  617.   ."         Use a Joystick to move the gun turret from left to right"
  618.   CR
  619.   CR
  620.   ."         Use mouse to move the hardware sprite around the screen"
  621.   CR
  622.   CR
  623.   ."        **********************************************************"
  624.   CR
  625.  
  626.   WAITSPACE
  627.  
  628.   SCRCLR
  629.  
  630.  
  631.   ERROR1 SETERROR"       \ Redirect system errors to our routine ERROR1
  632.  
  633.   CREATE_DSLICES
  634.   CREATE_RASINFO
  635.   CREATE_IMAGERY
  636.   CREATE_DISPLAY
  637.   CREATE_SLICECONTROL
  638.   CREATE_COPPER
  639.   CREATE_SPRITE
  640.  
  641.   SetupHSPrite ERROR" Failed to open HSprite!"
  642.  
  643.   HeliOS_On
  644.  
  645.   GunSpriteSet 8. D+ D@L INSTALLSPRITE
  646.  
  647.   1 FrameRate !L
  648.  
  649.   Display1 SHOWDISPLAY
  650.  
  651.   BEGIN
  652.     WAITFRAME
  653.  
  654.     TestHSprite
  655.  
  656.     MoveGun
  657.  
  658.     ?TERMINAL 27 =
  659.   UNTIL
  660.  
  661.   -3 GunSpriteSet 8. D+ D@L SpriteCtrl_Flags INDEX!L
  662.  
  663.   5 DELAY
  664.  
  665.   HeliOS_Off
  666.  
  667.   0 REPORTMOUSE
  668.  
  669.   CLOSEDOWN
  670.   ;
  671.  
  672.   TestDisplay
  673.